<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/constrant.jsp"%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>接送机-详情页</title>
		<link rel="stylesheet" href="${ctxStatic }/gov/css/govday.css" />
		<link rel="stylesheet" href="${ctxStatic }/gov/css/gov_total.css" />
		<script src="${ctxStatic }/jquery/jquery-1.8.3.min.js"></script>
		<script src="${ctxStatic}/jquery/jquery.validate.js" type="text/javascript"></script>
		<script type="text/javascript" src="${ctxStatic }/gov/js/messages_zh.js" ></script>
		<script type="text/javascript" src="${ctxStatic }/gov/js/gov.js"></script>
	</head>
        <script>
         $(function(){
         /*表单验证*/
	$('#govdayt').validate({
	       rules:{
	    	   purchasenum:"required",
	    	   contacts:"required",
	    	   payertel:{
					required:true,
					isMobile : true
				}
	    },	    
	   messages:{
		   purchasenum: "<i class='verico'></i>请输入辆数",
		   contacts:"<i class='verico'></i>请填写联系人",
		   payertel:{
				required:"<i class='verico'></i>请输入手机号码",
				isMobile :"<i class='verico'></i>请输入正确手机号码"
				}
	   },
     
	});		
		/*手机验证*/
	jQuery.validator.addMethod("isMobile", function(value, element) {
	            var length = value.length;
	            var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
	            return this.optional(element) || (length == 11 && mobile.test(value));
	        }, "请正确填写您的手机号码");
	
	$('#purchasenum').trigger('change');
        	})
        	function accMul(arg1, arg2) {
		var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
		try {
			m += s1.split(".")[1].length;
		} catch (e) {
		}
		try {
			m += s2.split(".")[1].length;
		} catch (e) {
		}
		return Number(s1.replace(".", "")) * Number(s2.replace(".", ""))
				/ Math.pow(10, m);
	}
        </script>
	<body>
		<%@include file="../index/head.jsp" %>
		<div id="govday">
			<div class="govday-main">
			 <form id="govdayt" action="${ctxGov}/submitAirRentOrder" method="post">
			    <input type="hidden" name="ordername" value="${tRentproduct.productname  }" />
			    <input type="hidden" name="boardaddr" value="${tRentproduct.aboardAddress }" />
			    <input type="hidden" name="departcity.sitename" value="${tRentproduct.departcity.sitename }" />
			    <input type="hidden" name="destcity.sitename" value="${tRentproduct.destcity.sitename}" />
				<input type="hidden" name="ordertype" value="6" />
				<input type="hidden" name="totalPrice" value="${ tRentproduct.office.suitrtnprice}" id="totalPrice" />
				<input type="hidden" name="office.id" value="${tRentproduct.office.id }" />
				<input type="hidden" name="office.name" value="${tRentproduct.office.abbr }" />
				<input type="hidden" name="office.iswifi" value="${tRentproduct.office.iswifi }" />
				<input type="hidden" name="office.powersupply" value="${tRentproduct.office.powersupply }" />
				<input type="hidden" name="office.tablewater" value="${tRentproduct.office.tablewater }" />
				<input type="hidden" name="office.businesssuit" value="${tRentproduct.office.businesssuit }" />
				<input type="hidden" name="office.paper" value="${tRentproduct.office.paper }" />
				<input type="hidden" name="fromdateStr" value="${tRentproduct.fromdateStr }" />
				<input type="hidden" name="time" value="${tRentproduct.time }" />
				<input type="hidden" name="cargotype.typedesc" value="${tRentproduct.cargotype.typedesc }" />
				<input type="hidden" name="cargotype.typename" value="${tRentproduct.cargotype.typename  }" />
				<input type="hidden" name="cargotype.cargotypeid" value="${tRentproduct.cargotype.cargotypeid  }" />
				
				<input type="hidden" name="money" value="${tRentproduct.office.suitrtnprice}" id="cost_dc" />
				<div class="govtotal-box">
					<div class="govtotal-top">
						<div class="govtotal-t-abside">
							<div class="govtotal-ta-tit">
								<h5>详情信息</h5>
							</div>
							<div class="govtotal-ta-box">
								<div class="g-tabox-img">
									<img src="../${tRentproduct.cargotype.images}" />
									<p>${tRentproduct.cargotype.typename }</p>
								</div>
								<div class="g-tabox-exe">
									<ul class="g-tabox-list">
										<li>
											<span class="tabox-il-tit">产品名称：</span>
											<span class="tabox-il-txt">
											<c:if test="${fn:length(tRentproduct.productname) > 25 }">
												${fn:substring(tRentproduct.productname,0,25)}...
											</c:if>
											<c:if test="${fn:length(tRentproduct.productname)  <= 25 }">
												${tRentproduct.productname }
											</c:if>
											</span>
										</li>
										<li>
											<span class="tabox-il-tit">上车地点：</span>
											<span class="tabox-il-txt">	${tRentproduct.aboardAddress }</span>
										</li>
										<li>
											<span class="tabox-il-tit">用车时间：</span>
											<span class="tabox-il-txt">${tRentproduct.fromdateStr }</span>
										</li>
										<li>
											<span class="tabox-il-tit">服务车队：</span>
											<span class="tabox-il-txt">${tRentproduct.office.abbr }</span>
										</li>
										<li>
											<span class="tabox-il-tit">特色服务：</span>
											<span class="tabox-il-txt">
												<c:if test="${tRentproduct.office.iswifi == '1' }">无线wifi</c:if>
												<c:if test="${tRentproduct.office.powersupply == '1' }">车载充电</c:if>
												<c:if test="${tRentproduct.office.tablewater == '1' }">免费饮用水</c:if>
												<c:if test="${tRentproduct.office.businesssuit == '1' }">商务正装</c:if>
												<c:if test="${tRentproduct.office.paper == '1' }">免费纸巾</c:if> 	
											</span>
										</li>
									</ul>
								</div>
							</div>
						</div>
						<div class="govtatal-t-right">
							<div class="govtatal_cost">
								<i class="cost_icon"></i>
								<h5>费用明细：</h5>
							</div>
							<p class="cost-txt">费用包含：【一价全包】全程司机代驾服务费、车辆使用费、车辆油电费、 空驶费、夜间服务费、司机小费、路桥费、停车费、摆渡费。</p>
							<p>
								<span>价格：￥
								<font id="totalcostd">
								<c:set var="totalPrice" value="${tRentproduct.office.suitrtnprice }"/>${totalPrice}
								</font>
								</span> 
								<input class="btnyd" type="submit" id="costbtn" value="预定" style="float: right;margin-right: 80px;">
							</p>
						</div>
					</div>
					<div class="govtotal-body">
						<div class="govtotal-b-left">
							<div class="gov-list-fill">
								<div class="fill-list-title">
									<h5>填写信息</h5>
								</div>
								<ul class="g-fill-list">
									<li class="fill-list-il">
										<lable><span>车辆数：</span><input type="number" id="purchasenum" name="purchasenum" min="1" max="10" value="${not empty orders.purchasenum?orders.purchasenum:'1' }" /></lable>
									</li>
									<li class="fill-list-il">
										<lable><span>联系人：</span><input type="text" placeholder="联系人姓名" id="govd-name"  name="contacts"/></lable>
									</li>
									<li class="fill-list-il">
										<lable><span>联系电话：</span><input type="text" placeholder="输入手机号" id="govd-iphone" name="payertel" value="${tel}"/></lable>
									</li>
								</ul>
							</div>
							<div class="fill-notice">
									<h5>重要提示：</h5>
									<p>
									1.如您的预订时间距离发车时间在12小时以内，为保证您的顺利出行，请保持您的电话畅通。</br> 
									2.如产生不含费用项请在服务结束后，将钱面付司机。严禁司机额外乱收费，如发现可联系霞客约车客服核实退还。</br> 
									3.开具发票:如需发票，由霞客约车根据订单金额统一开具。请在服务完成后至我的账户—关于发票—立即开票填写开票信息，开票总金额为订单费用。</br> 
									4.接送站包车一口价产品不能临时改变路线。如您需要送达同城多个地址或在多个地址上车，司机会合理安排行驶路线。如您需要送达多个城市或在多个城市上车，请分开下单。 
									</p>
							</div>
						</div>
						<div class="govtotal-b-abside">
							<div class="g-b-cancel">
								<i class="cancel_icon"></i>
								<h5>取消须知：</h5>
							</div>
							<div class="cancel-txts">
								<p>
									●该产品支持取消。</br>
									●出行日期前24小时前取消，免收违约金；</br>
									●出行日期前24小时至12小时取消，收取费用总额10%的违约金；</br>
									●出行日期前12小时至2小时取消，收取费用总额30%的违约金；</br>
									●出行开始前2小时取消，收取全额费用的违约金；</br>
									●超过发车时间不可退款。</br>
									●如需改期，请申请取消后重新预订。
								</p>
							</div>
						</div>
					</div>
				</div>
			    </form>
			</div>
		</div>
		 <%@include file="../index/foot.jsp" %>
	</body>
<script type="text/javascript">
$(function(){	
	$('#purchasenum').change(function(){
		var costnum=$('#cost_dc').val();
		var carsnum=$('#purchasenum').val();
		totalcost=carsnum*costnum;
		$('#totalcostd').text(totalcost);
		$('#totalPrice').val(totalcost);
	})
	
})
</script>
</html>